//
//  GJFEditPersonModel.m
//  Wedding
//
//  Created by 郭静芬 on 2017/1/11.
//  Copyright © 2017年 郭静芬. All rights reserved.
//

#import "GJFEditPersonModel.h"

@implementation GJFEditPersonModel

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    GJFUserInfo *userInfo = [GJFSingleTool shareInstance].userInfo;
    if ([self.key isEqualToString:@"编辑头像"]) {
        self.value = userInfo.avatar;
    }
    else if ([self.key isEqualToString:@"昵称"]) {
        self.value = userInfo.nickname;
    }
    else if ([self.key isEqualToString:@"真实姓名"]) {
        self.value = userInfo.realname;
    }
    else if ([self.key isEqualToString:@"性别"]) {
        self.value = userInfo.sex;
    }
    else if ([self.key isEqualToString:@"手机号"]) {
        self.value = userInfo.mobile_number;
    }
    else if ([self.key isEqualToString:@"E-mail"]) {
        self.value = userInfo.email;
    }
    else if ([self.key isEqualToString:@"地区"]) {
        self.value = [NSString stringWithFormat:@"%@ %@", userInfo.prov?:@"", userInfo.city?:@""];
    }
    else if ([self.key isEqualToString:@"个性签名"]) {
        self.value = userInfo.signature;
    }
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"key:%@ value:%@", self.key, self.value];
}

@end
